﻿<?php
ignore_user_abort(TRUE);
require_once("./interface.php");
require_once("./utils.php");
require_once("./interface.php");
require_once("./TechnicFunc.php");
require_once("./SoldierFunc.php");
require_once("./HotelFunc.php");
require_once("./OfficeFunc.php");
require_once("./MarketFunc.php");
require_once("./UnionFunc.php");
require_once("./StoreFunc.php");
require_once("./TroopFunc.php");
require_once("./global.php");
require_once("./report.php");

//mysql_connect()函数
$con = mysql_connect("127.0.0.1","root","111111");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("sanguo1", $con);//链接数据库
mysql_query("DELETE from sys_user_cityresource ");
$citys=sql_fetch_into_arrays("select * from sys_city order by uid desc");//用户城池表
$i=0;
while($i<=20000)
  {
$city_cid=$citys['cid'][$i];
$city_uid=$citys['uid'][$i];
$citys_r=sql_fetch_into_arrays("select * from mem_city_resource where cid='$city_cid'");//mem_city_resource 取数
$citys_r_people=$citys_r['people'][0];
mysql_query("INSERT INTO sys_user_cityresource (cid,uid,people) 
VALUES ('$city_cid', '$city_uid', '$citys_r_people')");
echo $city_cid."----".$city_uid."----".$citys_r_people."<br/>";
  $i=$i+1;
  }
 mysql_close($con);
?>



